const axios =  require('axios');
// 送养表单
export function saveAdoption (params) {
  return new Promise((resolve, reject) => {
    console.log(params,'params');
    // insertAdopt
    axios.post('/insertAdopt',params).then(({data})=>{
      resolve({
        'code': 10000,
        'message': data.errorMessage,
        'datas': {}
      })
    }).catch(()=>{
      reject()
    })
  })
}
// 领养表格接口
export function queryAdoptList (params) {
  return new Promise((resolve, reject) => {
    axios.post('/queryAdopt').then(({data})=>{
      let result = data.data || []
      resolve({
        code: 10000,
        message: '送养成功',
        datas: result,
        total: result.length
      })
    })
    
  })
}

// 删除表格接口
export function delAdoptList (params) {
  return new Promise((resolve, reject) => {
    axios.post('/deleteAdopt',params).then(({data})=>{
      resolve({
        code: 10000,
        message: '删除成功',
        datas: []
      })
    })
    
  })
}